Metadata.XIL

Metadata.XIL is the default indexsheet for metadata using RDF and Dublin Core. The Metadata.XIL indexsheet indexes each element as a separate field. Fields are applied and named after element names. The convention is dc:name in all lower case. Thus for "Title" field dc:title is applied. The most common fields are pre-defined. Additional fields can be defined to match your metadata.

<?xml version='1.0'?>

<!-- Default indexsheet for Metadata RDF.
Indexes all elements in separate fields. 
term-list="yes" proximity="no" so separate term list 
created for each each field rather than using proximity field
but still searchable in general non-field search.
Use exclusive="yes" instead to only index in specific 
field (not searchable in general non field search. -->

<xsl:stylesheet case-sensitive="no" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:np="http://www.rocketsoftware.com/ns/indexsheet/2.0" 
extension-element-prefixes="np">
          
<np:definitions>
    <field name="dc:title" type="text" term-list="yes" 
    proximity="no" relevance="highest" />
    <field name="dc:creator" type="text" term-list="yes" 
    proximity="no" relevance="highest" />
    <field name="dc:subject" type="text" term-list="yes" 
    proximity="no" relevance="highest" />
    <field name="dc:description" type="text" term-list="yes" 
    proximity="no" relevance="highest" />
    <field name="dc:publisher" type="text" term-list="yes" 
    proximity="no" relevance="higher" />
    <field name="dc:contributor" type="text" term-list="yes" 
    proximity="no" relevance="higher" />
    <field name="dc:language" type="text" term-list="yes" 
    proximity="no" />
    <field name="dc:date" type="date" term-list="yes" 
    proximity="no" />
</np:definitions>

<!-- match title and mark as toc-heading -->
    <xsl:template match='dc:title'>
        <np:index field="dc:title" toc-heading="yes">
            <xsl:apply-templates/>
        </np:index>  
    </xsl:template>

    <!-- match root element rdf:RDF and rdf:Description, 
		   don't apply field because each child is indexed -->
    <xsl:template match='rdf:RDF|rdf:Description'>
         <np:index>
            <xsl:apply-templates/>
         </np:index>  
    </xsl:template>

    <!-- match all elements and index each with 
	      default text field named after element name -->
    <xsl:template match='*'>
        <np:index field-element-name="yes">
            <xsl:apply-templates/>
        </np:index>  
    </xsl:template>
     
</xsl:stylesheet>